def to_bytes(content):
    if isinstance(content, bytes):
        return content
    return content.encode('utf-8')
